<table cellpadding="0" cellspacing="0" width="100%" align="left" class="table-list">
    <col width="75%">
    <col width="25%">
        <tr class="alt">
            <td>
                <ul class="ul-list-order">
                    <li class="list-order-header">Họ tên</li>
                    <li><?php echo $aryCustomer['customer_full_name'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Ngày sinh</li>
                    <li><?php echo date("d/m/Y", strtotime($aryCustomer['customer_date_birthday']));?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Địa chỉ</li>
                    <li><?php echo $aryCustomer['customer_address'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Điện thoại bàn</li>
                    <li><?php echo $aryCustomer['customer_home_phone'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Điện thoại di dộng</li>
                    <li><?php echo $aryCustomer['customer_mobile_phone'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Email</li>
                    <li><?php echo $aryCustomer['customer_email'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Yahoo</li>
                    <li><a href="ymsgr:sendIM?<?php echo $aryCustomer['customer_yahoo']; ?>"><img border="0" align="absmiddle" src="http://opi.yahoo.com/online?u=<?php echo $aryCustomer['customer_yahoo']; ?>&amp;m=g&amp;t=1"></a></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Skype</li>
                    <li><a href="skype:<?php echo $aryCustomer['customer_skype']; ?>?chat"><img src="http://mystatus.skype.com/smallicon/<?php echo $aryCustomer['customer_skype']; ?>"></a></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Ngày tham gia</li>
                    <li><?php echo date("d/m/Y", strtotime($aryCustomer['customer_join_date']));?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Ngân hàng</li>
                    <li><?php echo $aryCustomer['customer_bank_name'];?></li>
                </ul>
                <ul class="ul-list-order">
                    <li class="list-order-header">Số tài khoản</li>
                    <li><?php echo $aryCustomer['customer_bank_number'];?></li>
                </ul>
                
            </td>
            <td>
                <div>
                    Trạng thái: <?php if($aryOrderDetail['order_detail_is_process'] == 0){?>
                                    Chưa xử lý
                                <?php }else if($aryOrderDetail['order_detail_is_process'] == 1){ ?>
                                    Đã xử lý
                                <?php }else{?>
                                    Đang chờ xử lý
                                <?php } ?>
                </div>
                <?php if($aryOrderDetail['order_detail_process_date'] != '' && $aryOrderDetail['order_detail_process_date'] != '0000-00-00 00:00:00'){?>
                    <div>
                        Ngày cập nhật: <?php echo date('d/m/Y', strtotime($aryOrderDetail['order_detail_process_date']));?>
                    </div>
                <?php } ?>
            </td>
        </tr>

</table>
<table cellpadding="0" cellspacing="0" width="100%" align="left" class="table-list">
    
    <tr class="alt">
        <td colspan="13">
                <div style="font-weight: bold;">
                    Danh sách sản phẩm tháng <?php echo $month;?> của CTV  <span style="color: #E2C822"><?php echo $aryCustomer['customer_full_name'];?></span>
                </div>
            </td>
        </tr>
        <tr class="">
            <td class="order_product_title">
                Ngày
            </td>
            <td class="order_product_title">
                Tên sản phẩm
            </td>
            <td class="order_product_title">
                SL/ĐV
            </td>
            <td class="order_product_title">
                Giá nhập
            </td>
            <td class="order_product_title">
                Giá bán
            </td>
            <td class="order_product_title">
                Lãi
            </td>
            <td class="order_product_title">
                Thuế 25%
            </td>
            <td class="order_product_title">
                Phí VC
            </td>
            <td class="order_product_title">
                Phí DV
            </td>
            <td  class="order_product_title">
                Lợi nhận
            </td>
            <td  class="order_product_title">
                Tiền CTV
            </td>
            <td  class="order_product_title">
                Tiền KD
            </td>
            <td  class="order_product_title">
                T.Tác
            </td>
        </tr>
        <?php $totalMemberProfit = 0; $totalCtvProfit = 0; foreach ($aryCustomerProduct as $key => $value) {?>
        <?php $totalMemberProfit+=$value['customer_product_kd_profit']; $totalCtvProfit+=$value['customer_product_ctv_profit'];?>
            <tr class="<?php echo ($key%2 == 0) ? 'alt' : '';?>">
                <td align="left">
                    <?php echo date("d/m/Y", strtotime($value['customer_product_date_process']));?>
                </td>
                <td>
                    <?php echo $value['customer_product_product_name'];?>
                </td>
                <td>
                    <?php echo $value['customer_product_number'];?>/<?php echo $value['customer_product_unit'];?>
                </td>
                <td>
                    <?php echo number_format($value['customer_product_in_price'], 0, ',', '.'); ?>
                </td>
                <td>
                    <?php echo number_format($value['customer_product_out_price'], 0, ',', '.'); ?>
                </td>
                <td>
                    <?php echo number_format($value['customer_product_total_price'], 0, ',', '.'); ?>
                </td>
                <td>
                     <?php echo number_format($value['customer_product_is_tax'], 0, ',', '.'); ?>
                </td>
                <td>
                    <?php echo number_format($value['customer_product_transport'], 0, ',', '.'); ?>
                </td>
                <td>
                    <?php echo number_format($value['customer_product_services'], 0, ',', '.'); ?>
                </td>
                <td>
                    <?php echo number_format($value['customer_product_total_profit'], 0, ',', '.'); ?>
                </td>
                <td>
                    <?php echo number_format($value['customer_product_ctv_profit'], 0, ',', '.'); ?>
                </td>
                <td>
                    <?php echo number_format($value['customer_product_kd_profit'], 0, ',', '.'); ?>
                </td>
                <td>
                        <img class="cpointer" title="Chỉnh sửa lại thông tin về sản phẩm này." src="<?php echo $sub_domain;?>/images/form/icon-edit.gif" onclick="AdminController.editCtvProduct('<?php echo $value['customer_product_id'];?>');">
                </td>
            </tr>
        <?php } ?>
        
        <tr class="alt">
            <td colspan="13" align="right">
                <div><span>Tổng số tiền CTV này được hưởng: </span><span style="padding-left: 10px;"><?php echo number_format($totalCtvProfit, 0, ',', '.');?>(VNĐ)</span></div>
                <div><span>Tổng số tiền KD được hưởng: </span><span style="padding-left: 10px;"><?php echo number_format($totalMemberProfit, 0, ',', '.');?>(VNĐ)</span></div>
            </td>
        </tr>
        
</table>
<form name="frmEditProductCustomer" id="frmEditProductCustomer">
    <table cellpadding="0" cellspacing="0" class="table-form-post" width="100%" align="left">
    <tr>
        <td colspan="2">
            <div style="font-weight: bold;">
                <div id="title_add_ctv_product">Thêm sản phẩm tháng <?php echo $month;?> cho CTV  <span style="color: #E2C822"><?php echo $aryCustomer['customer_full_name'];?></span></div>
                <div id="title_update_ctv_product" class="hide">Cập nhật sản phẩm cho CTV <span style="color: #E2C822"><?php echo $aryCustomer['customer_full_name'];?></span></div>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            Tên sản phẩm
        </td>
        <td>
            <span><input type="text" name="customer_product_product_name" id="customer_product_product_name" class="w300p"></span><span id="customer_product_product_name_error" class="validate_error" style="display: none;"></span>
        </td>
    </tr>
    <tr>
        <td>
            Giá nhập&nbsp;(VNĐ)
        </td>
        <td>
            <span><input name="customer_product_in_price" id="customer_product_in_price" type="text" class="w100p" onkeyup="AdminController.formatCurrency('customer_product_in_price_format', 'customer_product_in_price');" onchange="AdminController.formatCurrency('customer_product_in_price_format', 'customer_product_in_price');"></span><span id="customer_product_in_price_format"></span><span id="customer_product_in_price_error" class="validate_error" style="display: none;"></span>
        </td>
    </tr>
    <tr>
       <td>
            Giá bán&nbsp;(VNĐ)
        </td>
        <td>
            <span><input name="customer_product_out_price" id="customer_product_out_price" type="text" class="w100p" onkeyup="AdminController.formatCurrency('customer_product_out_price_format', 'customer_product_out_price');" onchange="AdminController.formatCurrency('customer_product_out_price_format', 'customer_product_out_price');"></span><span id="customer_product_out_price_format"></span><span id="customer_product_out_price_error" class="validate_error" style="display: none;"></span>
        </td>
    </tr>
    <tr>
        <td>
            Số lượng
        </td>
        <td>
            <input type="text" class="w100p" name="customer_product_number" id="customer_product_number"><span id="customer_product_number_error" class="validate_error" style="display: none;"></span>
        </td>
    </tr>
    <tr>
        <td>
            Đơn vị
        </td>
        <td>
            <input type="text" class="w100p" name="customer_product_unit" id="customer_product_unit"><span id="customer_product_unit_error" class="validate_error" style="display: none;"></span>
        </td>
    </tr>
    <tr>
        <td>
            Phí vận chuyển
        </td>
        <td>
            <input type="text" class="w100p" name="customer_product_transport" id="customer_product_transport" onkeyup="AdminController.formatCurrency('customer_product_transport_format', 'customer_product_transport');" onchange="AdminController.formatCurrency('customer_product_transport_format', 'customer_product_transport');"><span id="customer_product_transport_format"></span><span id="customer_product_transport_error" class="validate_error" style="display: none;"></span>
        </td>
    </tr>
    <tr>
        <td>
            Phí dịch vụ
        </td>
        <td>
            <input type="text" class="w100p" name="customer_product_services" id="customer_product_services" onkeyup="AdminController.formatCurrency('customer_product_services_format', 'customer_product_services');" onchange="AdminController.formatCurrency('customer_product_services_format', 'customer_product_services');"><span id="customer_product_services_format"></span><span id="customer_product_services_error" class="validate_error" style="display: none;"></span>
        </td>
    </tr>
    <tr>
        <td>
            Chênh lệch
        </td>
        <td>
            <input type="text" class="w100p" name="customer_product_disparity" id="customer_product_disparity" onkeyup="AdminController.formatCurrency('customer_product_disparity_format', 'customer_product_disparity');" onchange="AdminController.formatCurrency('customer_product_disparity_format', 'customer_product_disparity');"><span id="customer_product_disparity_format"></span><span id="customer_product_disparity_error" class="validate_error" style="display: none;"></span>
        </td>
    </tr>
    <tr>
        <td align="left">
            <input class="submit" type="button" id="edit_ctv_product" value="Thêm sản phẩm" onclick="AdminController.addProductForCtv();">
            <input type="hidden" name="customer_product_customer_id" id="customer_product_customer_id" value="<?php echo $aryCustomer['customer_id'];?>">
            <input type="hidden" name="customer_product_id" id="customer_product_id">
        </td>
        <td>
            <div id="cancel_edit_ctv_product" class="hide">
                <input class="submit" type="button" value="Hủy bỏ" onclick="AdminController.cancelEditCtvProduct();">
            </div>
        </td>
    </tr>
</table>
</form>

